package model;
// Generated 03-ene-2014 23:51:10 by Hibernate Tools 3.6.0


import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Menu generated by hbm2java
 */
@Entity
@Table(name="menu"
    ,schema="public"
)
public class Menu  implements java.io.Serializable {


     private int idMenu;
     private Menu menu;
     private Integer nivel;
     private Integer orden;
     private String nombreMenu;
     private String url;
     private String icono;
     private Integer estadoMenu;
     private Set menus = new HashSet(0);
     private Set rols = new HashSet(0);

    public Menu() {
    }

	
    public Menu(int idMenu) {
        this.idMenu = idMenu;
    }
    public Menu(int idMenu, Menu menu, Integer nivel, Integer orden, String nombreMenu, String url, String icono, Integer estadoMenu, Set menus, Set rols) {
       this.idMenu = idMenu;
       this.menu = menu;
       this.nivel = nivel;
       this.orden = orden;
       this.nombreMenu = nombreMenu;
       this.url = url;
       this.icono = icono;
       this.estadoMenu = estadoMenu;
       this.menus = menus;
       this.rols = rols;
    }
   
     @Id 

    
    @Column(name="id_menu", unique=true, nullable=false)
    public int getIdMenu() {
        return this.idMenu;
    }
    
    public void setIdMenu(int idMenu) {
        this.idMenu = idMenu;
    }

@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="men_id_menu")
    public Menu getMenu() {
        return this.menu;
    }
    
    public void setMenu(Menu menu) {
        this.menu = menu;
    }

    
    @Column(name="nivel")
    public Integer getNivel() {
        return this.nivel;
    }
    
    public void setNivel(Integer nivel) {
        this.nivel = nivel;
    }

    
    @Column(name="orden")
    public Integer getOrden() {
        return this.orden;
    }
    
    public void setOrden(Integer orden) {
        this.orden = orden;
    }

    
    @Column(name="nombre_menu", length=80)
    public String getNombreMenu() {
        return this.nombreMenu;
    }
    
    public void setNombreMenu(String nombreMenu) {
        this.nombreMenu = nombreMenu;
    }

    
    @Column(name="url", length=120)
    public String getUrl() {
        return this.url;
    }
    
    public void setUrl(String url) {
        this.url = url;
    }

    
    @Column(name="icono", length=30)
    public String getIcono() {
        return this.icono;
    }
    
    public void setIcono(String icono) {
        this.icono = icono;
    }

    
    @Column(name="estado_menu")
    public Integer getEstadoMenu() {
        return this.estadoMenu;
    }
    
    public void setEstadoMenu(Integer estadoMenu) {
        this.estadoMenu = estadoMenu;
    }

@OneToMany(fetch=FetchType.LAZY, mappedBy="menu")
    public Set getMenus() {
        return this.menus;
    }
    
    public void setMenus(Set menus) {
        this.menus = menus;
    }

@ManyToMany(fetch=FetchType.LAZY)
    @JoinTable(name="accede", schema="public", joinColumns = { 
        @JoinColumn(name="id_menu", nullable=false, updatable=false) }, inverseJoinColumns = { 
        @JoinColumn(name="rol_id", nullable=false, updatable=false) })
    public Set getRols() {
        return this.rols;
    }
    
    public void setRols(Set rols) {
        this.rols = rols;
    }




}


